import { IsNotEmpty, IsString,Length,Matches } from "class-validator"

export class RegisterDto {
    @IsString()
    @IsNotEmpty()
    @Length(1,30)
    @Matches(/^[a-zA-Z0-9#$%_-]+$/, {
        message: '用户名只能是字母、数字或者 #、$、%、_、- 这些字符'
    })
    username:string;
    @IsString() 
    @IsNotEmpty() 
    @Length(6, 30,{
        message:'密码长度为6到30位'
    })
    password:string;
    
    @IsNotEmpty()
    code:string;
}